﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace DrawIO45.Models.Logic
{
    public class LPropertyInfo
    {
        /// <summary>
        /// 字段名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 逻辑Id
        /// </summary>
        public string Id { get; set; } = Guid.NewGuid().ToString();

        /// <summary>
        /// 原信息
        /// </summary>
        public PropertyInfo Source { get; set; }

        public LPropertyInfo() { }

        public LPropertyInfo(PropertyInfo propertyInfo)
        {
            Source = propertyInfo;
            Name = propertyInfo.Name;
        }

        public string GetFormatName()
        {
            return $"+ {Name}:{LHelper.GetTypeName(Source.PropertyType)}";
        }
    }
}
